package com.nft.gateway.app.config;

import com.nft.po.NftResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * Demo class
 *
 * @author keriezhang
 * @date 2016/10/31
 */
@Slf4j
@RestControllerAdvice
public class ExceptionConfig {

    /**
     * 全局监听异常
     *
     * @param e
     * @return
     */
    @ExceptionHandler(value = Exception.class)
    public NftResponse excepetionHandler(Exception e) {
        return new NftResponse<>("500",e.getMessage(),false);
    }

}